package com.adkfp.service.impl;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.adkfp.bean.ADKDeptBean;
import com.adkfp.dao.ADKDeptDaoMapper;
import com.adkfp.service.IADKDeptService;

/**
 * class name:ADKDeptService实现类 <BR>
 * class description: ADKDept表的增删改查 <BR>
 * Remark: <BR>
 * @version 1.00 2019年01月03日
 * @author JACK)jackwei
 */
@Service("aDKDeptService")
public class ADKDeptServiceImpl implements IADKDeptService {
	@Resource
	private ADKDeptDaoMapper aDKDeptMapper;

	/**
	 * @Override
	 * Method name: insert <BR>
	 * Description: 插入一条记录 <BR>
	 * Remark: <BR>
	 * @param bean  <BR>
	*/
	@Override
	@Transactional
	public void insert(ADKDeptBean bean) {
		aDKDeptMapper.insert(bean);
	}

	/**
	 * @Override
	 * Method name: delete <BR>
	 * Description: 删除一条记录 <BR>
	 * Remark: <BR>
	 * @param id  <BR>
	*/
	@Override
	@Transactional
	public void delete(String id) {
		aDKDeptMapper.delete(id);
	}

	/**
	 * @Override
	 * Method name: update <BR>
	 * Description: 更新一条记录 <BR>
	 * Remark: <BR>
	 * @param bean  <BR>
	*/
	@Override
	@Transactional
	public void update(ADKDeptBean bean) {
		aDKDeptMapper.update(bean);
	}

	/**
	 * @Override
	 * Method name: findById <BR>
	 * Description: 根据id获取一条记录 <BR>
	 * Remark: <BR>
	 * @param id
	 * @return  <BR>
	*/
	@Override
	public ADKDeptBean findById(String id) {
		return aDKDeptMapper.findById(id);
	}

	/**
	 * @Override
	 * Method name: findByCondition <BR>
	 * Description: 根据bean里面的条件(判空)查询所有记录 <BR>
	 * Remark: <BR>
	 * @param bean
	 * @return  <BR>
	*/
	@Override
	@Transactional
	public List<ADKDeptBean> findByCondition(ADKDeptBean bean) {
		return aDKDeptMapper.findByCondition(bean);
	}

	/**
	 * @Override
	 * Method name: findByConditionCount <BR>
	 * Description: 根据bean里面的条件(判空)查询所有记录条数 <BR>
	 * Remark: <BR>
	 * @param bean
	 * @return  <BR>
	*/
	@Override
	@Transactional
	public long findByConditionCount(ADKDeptBean bean) {
		return aDKDeptMapper.findByConditionCount(bean);
	}

	//查找所有部门的名称
	@Override
	public List<ADKDeptBean> selectDpetName() {
		return aDKDeptMapper.selectDpetName();
	}

	//查找部门的名称
	@Override
	public List<ADKDeptBean> selectdpetname() {
		return aDKDeptMapper.selectdpetname();
	}

	//查找部门层级
	@Override
	public List<ADKDeptBean> selectLevel(String id) {
		return aDKDeptMapper.selectLevel(id);
	}

	//验证名称唯一(FMY)
	@Override
	public long checkSname(ADKDeptBean bean) {
		return aDKDeptMapper.checkSname(bean);
	}
}